<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/OutletManagementTemplate.xhtml">

    <ui:define name="contentInsert">

        <h:form id="form1">
            <p:ajaxStatus style="width:20px;height:20px;">
                <f:facet name="start">
                    <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                </f:facet>
                <f:facet name="complete">
                    <h:outputText value="" />
                </f:facet>
            </p:ajaxStatus>
            <p:messages id="msg"/>
            <h:panelGrid columns="4">
                <h:outputLabel for="noShowPenalty" value="No-show Fee: "/>
                <p:inputText required="true" requiredMessage="no show fee amount required"
                             id="noShowPenalty" value="#{outletManagerIOTRManagedBean.noShowPenalty}"/>
                <h:outputLabel/>
                <p:message for="noShowPenalty"/>

                <h:outputLabel for="confirmation" value="Confirmaion: "/>
                <h:selectOneRadio id="confirmation" value="#{outletManagerIOTRManagedBean.autoConfirmReservation}"
                                  tabindex="2" >
                    <f:selectItem id="auto" itemLabel="automatic" itemValue="true" />
                    <f:selectItem id="manual" itemLabel="manual" itemValue="false"/>
                </h:selectOneRadio>
                <p:message for="confirmation"/>
                <h:outputLabel/>

                <h:outputLabel for="leadTime_Day" value="Lead Time: "/>
                <p:inputText required="true" requiredMessage="lead time needed!" id="leadTime_Day"
                             value="#{outletManagerIOTRManagedBean.leadTime_Day}">
                    <f:validateRegex pattern="\d+"/>
                </p:inputText>
                <h:outputLabel for="leadTime_Day" value="Days" />
                <p:message for="leadTime_Day"/>

                <h:outputLabel for="bookingWindow" value="Reservation Window: "/>
                <p:inputText required="true" requiredMessage="reservation window needed!" id="bookingWindow"
                             value="#{outletManagerIOTRManagedBean.bookingWindow}">
                    <f:validateRegex pattern="\d+"/>
                </p:inputText>
                <h:outputLabel for="bookingWindow" value="Days" />
                <p:message for="bookingWindow"/>

            </h:panelGrid> 
            <p:commandButton id="updateGeneralInfo" value="Update" update="msg"
                             actionListener="#{outletManagerIOTRManagedBean.saveNewGeneralInfo}" />
        </h:form>
        
        
        
        <h:form id="CuisineEditForm">
            
            <p:panel> 
                <h4>The current cuisines for this outlet: </h4>
                <p:dataList value="#{outletManagerBean.outletManagerViewCuisines()}" var="o" itemType="disc">  
                    #{o.cuisineName} 
                </p:dataList> 
            </p:panel>
            
            
            <p:panel> 
                <h4>Define a new Cuisine List for this outlet</h4>
                Click on a cuisine name to select it. Hold Ctrl to select multiple cuisines<br/>
                <h:selectManyListbox value="#{outletManagerBean.selectedCuisinesIDs}" size="8" style="width: 250px;">
                    <f:selectItems value="#{outletManagerBean.getAllCuisines()}"  
                                   var="o" itemLabel="#{o.cuisineName}"  
                                   itemValue="#{o.cuisineName}" /> 
                </h:selectManyListbox>
                <br/>
                <p:commandButton value="Change Cuisine List" action="#{outletManagerBean.changeCuisineList()}" ajax="false" />
            </p:panel>
            
      
            
        </h:form>
        
        
        
        
        


    </ui:define>
</ui:composition>
